<include file="Public/head"/>
<body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>
    <style>
        .grouptd {
            position: relative;
        }

        .group {
            display: inline-block;
            width: 100%;
        }

        .groupselect {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border: 0;
        }
    </style>

    <include file="Public/sidebar"/>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs"/>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set"/>

                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                         <div class="row">
                            <form class="form-inline" action="" method="post">
                                <a class="btn btn-info" href="{:U('add')}" value="">新增</a>
                                
                               
                               
                                <!-- <label class="inline">&nbsp;&nbsp;时间段：</label>
                                <select name="order"  id = 'slot_name'class="form-control">
                                
                                </select>
                                <button type="submit" class="btn btn-purple btn-sm">
                                    <span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
                                    搜索
                                </button> -->
                            </form>
                        </div>
                        
                      		<div class="space-4"></div>
                        <div class="row">

                                <table class="table table-striped table-bordered table-hover">
                                    <thead>
                                    <tr>
                                        <!-- <th class="center"><input class="check-all" type="checkbox" value=""></th> -->
                                        <th class="center">ID</th>
                                        <th class="center">时间段名称</th>
                                        <th class="center">添加时间</th>
                                        <th class="center">状态</th>
                                        <th class="center">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <?php if(!empty($data)){ ?>
                                    <volist name="data" id="val" key='key'>
                                        <tr>
                                            <td class="center">{$key}</td>
                                            <td class="center">{$val['slot_name']}</td>
                                            <td class="center">{$val['add_time']|date="Y-m-d",###}</td>
                                            <td class="center">
                                             <if condition="$val['status'] eq 1">正常</if>
                                            </td>
                                            <td class="center">
                                             	<a href="{:U('detail',array('id'=>$val['id']))}">详情</a>
                                             	<!-- <a class='edit' href="javascript:;" val='{:U('edit',array('id'=>$val['id']))}'>编辑</a> -->
                                             	<a class='delete' href="javascript:;" val='{:U('delete',array('id'=>$val['id']))}'>删除</a>
                                            </td>
                                        </tr>
                                    </volist>
                                    	<?php }else{?>
                                    	<tr>
                                    		<td colspan='5' class='center'>暂未添加场地信息,请添加</td>
                                    	</tr>
                                    	
                                    	<?php } ?>
                                    </tbody>
                                </table>
                            <!-- <div class="cf">
                                <input id="submit" class="btn btn-info" type="button" value="删除">
                            </div> -->
                            {$page}
                        </div>
                        
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Public/footer"/>

</div><!-- /.main-container -->

<include file="Public/footerjs"/>
<!-- inline scripts related to this page -->
<script type="text/javascript">
$('.delete').click(function() {
	var url = $(this).attr('val');
	bootbox.confirm({
		title:'警告',
		message:'删除该信息不影响已发布教练排班时间段信息，确定删除吗？',
		callback:function(result){
			if(result){
				window.location.href = url;
			}
		},
		buttons:{
			'cancel':{'label':'取消'},
			'confirm':{
				'label':'确定',
				'className':'btn-danger'
			}
		}
	})
})

$('.edit').click(function() {
	var url = $(this).attr('val');
	bootbox.confirm({
		title:'警告',
		message:'编辑该组信息将会改变已发布时间段信息，确认编辑吗？',
		callback:function(result){
			if(result){
				window.location.href = url;
			}
		},
		buttons:{
			'cancel':{'label':'取消'},
			'confirm':{
				'label':'确定',
				'className':'btn-danger'
			}
		}
	})
})
    

</script>
</body>
</html>
